package com.skytech.component.monitor.data;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;


public interface WaterPollutionDataDAO extends JpaRepository<WaterPollutionData,String> {


    @Query(value="select * from water_pollution_data WHERE site_name  LIKE '%江苏%' GROUP BY site_name",nativeQuery = true)
    List<WaterPollutionData> findBySiteName();

    @Query(value = "select  * from water_pollution_data where site_name=:siteName order by crawling_time desc limit 1",nativeQuery = true)
    WaterPollutionData findOneBySiteName(@Param("siteName") String siteName);
}
